package com.wang.domain;

import org.springframework.beans.factory.FactoryBean;

/**
 * 测试FactoryBean创建Bean
 */
public class MyFactoryBean implements FactoryBean<Runnable> {

    /**
     * 对象实例
     */
    @Override
    public Runnable getObject() throws Exception {
        return () -> {
        };
    }

    /**
     * Bean类型
     */
    @Override
    public Class<?> getObjectType() {
        return Runnable.class;
    }

    /**
     * 是否单例，默认否
     */
    @Override
    public boolean isSingleton() {
        return true;
    }
}
